package com.ruoyi.project.jiaqin.twoclasstrend.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.twoclasstrend.mapper.TwoClassTrendMapper;
import com.ruoyi.project.jiaqin.twoclasstrend.domain.TwoClassTrend;
import com.ruoyi.project.jiaqin.twoclasstrend.service.ITwoClassTrendService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 二级分类价格走势Service业务层处理
 *
 * @author admin
 * @date 2021-01-09
 */
@Service
public class TwoClassTrendServiceImpl implements ITwoClassTrendService
{
    @Autowired
    private TwoClassTrendMapper twoClassTrendMapper;

    /**
     * 查询二级分类价格走势
     *
     * @param id 二级分类价格走势ID
     * @return 二级分类价格走势
     */
    @Override
    public TwoClassTrend selectTwoClassTrendById(String id)
    {
        return twoClassTrendMapper.selectTwoClassTrendById(id);
    }

    @Override
    public Integer selectNowStatusByTwoClassId(String twoClassId) {
        return twoClassTrendMapper.selectNowStatusByTwoClassId(twoClassId);
    }

    /**
     * 查询二级分类价格走势列表
     *
     * @param twoClassTrend 二级分类价格走势
     * @return 二级分类价格走势
     */
    @Override
    public List<TwoClassTrend> selectTwoClassTrendList(TwoClassTrend twoClassTrend)
    {
        return twoClassTrendMapper.selectTwoClassTrendList(twoClassTrend);
    }

    /**
     * 获取二级分类七天的走势
     * @param twoClassId
     * @return
     */
    @Override
    public List<TwoClassTrend> selectTwoClassTrendSevenDayByTwoClassId(String twoClassId) {
        return twoClassTrendMapper.selectTwoClassTrendSevenDayByTwoClassId(twoClassId);
    }

    /**
     * 获取二级分类三十天的走势
     * @return
     */
    public List<TwoClassTrend> selectTwoClassTrendMonthDayByTwoClassId(String twoClassId){
        return twoClassTrendMapper.selectTwoClassTrendMonthDayByTwoClassId(twoClassId);
    };
    /**
     * 新增二级分类价格走势
     *
     * @param twoClassTrend 二级分类价格走势
     * @return 结果
     */
    @Override
    public int insertTwoClassTrend(TwoClassTrend twoClassTrend)
    {
        return twoClassTrendMapper.insertTwoClassTrend(twoClassTrend);
    }

    /**
     * 修改二级分类价格走势
     *
     * @param twoClassTrend 二级分类价格走势
     * @return 结果
     */
    @Override
    public int updateTwoClassTrend(TwoClassTrend twoClassTrend)
    {
        return twoClassTrendMapper.updateTwoClassTrend(twoClassTrend);
    }

    /**
     * 删除二级分类价格走势对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTwoClassTrendByIds(String ids)
    {
        return twoClassTrendMapper.deleteTwoClassTrendByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除二级分类价格走势信息
     *
     * @param id 二级分类价格走势ID
     * @return 结果
     */
    @Override
    public int deleteTwoClassTrendById(String id)
    {
        return twoClassTrendMapper.deleteTwoClassTrendById(id);
    }
}
